<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:openiot="http://openiot.org/tags" xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:shiro="http://shiro.apache.org/tags">

<head />
<body>
	<ui:composition template="/WEB-INF/templates/main.xhtml">
		<ui:define name="title">Home Page</ui:define>
		<ui:define name="nav-links">
			<li class="active"><a href="home.jsf">Home</a></li>
			<openiot:hasPermission name="admin:user_mgmt_general">
				<li><a href="roles.jsf">Manage roles</a></li>
				<li><a href="users.jsf">Manage users</a></li>
				<li><a href="perms.jsf">Manage permissions</a></li>
				<openiot:hasPermission name="admin:add_services">
					<li><a href="services.jsf">Manage services</a></li>
				</openiot:hasPermission>
			</openiot:hasPermission>
			<shiro:user>
				<c:if test="${homeController.isDemoEnabled()}">
					<li><a href="guest_services.jsf">Guest services</a></li>
				</c:if>
			</shiro:user>
		</ui:define>
		<ui:define name="content">
			<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
			<p:layout fullPage="false" id="layout" style="min-height:800px; margin-top:10px;">
				<p:layoutUnit position="center">
					<div style="text-align: center;">
						<h1>Welcome to the OpenIoT Authentication &amp; Authorization Manager Webapp!</h1>
						<br />
						<openiot:lacksPermission name="admin:user_mgmt_general">
							<openiot:lacksRole name="admin">
								<span class="label label-warning">
									<h2>You don't have the required authorization for using this application.</h2>
								</span>
							</openiot:lacksRole>
						</openiot:lacksPermission>
					</div>
				</p:layoutUnit>

			</p:layout>
		</ui:define>
	</ui:composition>
</body>

</html>

